<?php
	include_once ("../configs/config.php");     //配置参数
	include_once ("../common/mysql.class.php");   //MySQL操作类
	include_once ("../common/action.class.php");   //MySQL操作类
	
	$user_id 	= $_COOKIE['user_id'];
	$nickname 	= $_POST['nickname'];
	$sex	 	= $_POST['sex'];
	$location	= $_POST['location'];
	$is_receive	= $_POST['is_receive'];
	
	if($nickname=="") $nickname="anonymous";
	if($sex=="") $sex=0;
	if($location=="") $location="secret";
	if($is_receive=="") $is_receive=0;
	$db = new action($mydbhost, $mydbuser, $mydbpw, $mydbname, "temp_conn", $mydbcharset, $mydbtag); //实例化数据库类
	$ret = $db->set_user_info($user_id,$nickname,$sex,$location, $is_receive);
	if($ret==0){
		echo "set user info ok";
	}
	else{
		echo "error:".$ret;
	}
?>
